import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../../main_page/provider/msg_provider.dart';

class NewerTimerVipCardWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return NewerTimerVipCardWidgetState();
  }
}

class NewerTimerVipCardWidgetState extends State<NewerTimerVipCardWidget> {
  @override
  Widget build(BuildContext context) {
    return Consumer<MineMsgProvider>(
      builder: (context, newser, child) {
        if (newser.timeEnd) {
          return SizedBox();
        } else {
          return Container(
            padding: EdgeInsets.symmetric(horizontal: 6, vertical: 3),
            decoration: BoxDecoration(
              color: Color(0xffFFD460),
              borderRadius: BorderRadius.circular(4),
            ),
            child: Text(
              '倒计时:${newser.countdown?.hourDesc ?? '00'}:${newser.countdown?.minDesc ?? '00'}:${newser.countdown?.secondsDesc ?? '00'}',
              style: TextStyle(color: Colors.black, fontSize: 10),
            ),
          );
        }
      },
    );
  }

  @override
  void dispose() {
    super.dispose();
  }
}
